<template>
  <ArticlePreview :article="article"></ArticlePreview>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { getArticle } from '../../api/index'
import type { Article } from '../../api/index'
import ArticlePreview from '@/components/ArticlePreview.vue'

const props = defineProps<{
  id: string
}>()

let article = ref({} as Article)

onMounted(async () => {
  let res = await getArticle(props.id)
  article.value = res.data.article
})
</script>
